/* Tippy.js 样式（用于斜杠命令弹出菜单） */
.tippy-box {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.tippy-content {
  padding: 0;
}

/* AI 生成加载动画 */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.ai-generating {
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 编辑器内的 AI 加载提示 */
.ProseMirror .ai-loading {
  color: #6b7280;
  font-style: italic;
}

.dark .ProseMirror .ai-loading {
  color: #9ca3af;
}

/* 斜杠命令触发提示 */
.ProseMirror .slash-command-active {
  background-color: rgba(156, 163, 175, 0.1);
  border-radius: 0.25rem;
  padding: 0 0.25rem;
}

.dark .ProseMirror .slash-command-active {
  background-color: rgba(156, 163, 175, 0.15);
}

/* 编辑器内容区域 */
.ProseMirror {
  padding: 2rem 0;
  font-family:
    'Inter',
    'Optima',
    'Candara',
    'Noto Sans SC',
    system-ui,
    -apple-system,
    sans-serif;
  caret-color: #57534e;
}

.dark .ProseMirror {
  caret-color: #a8a29e;
}
.ProseMirror p {
  line-height: 2.2;
  margin-bottom: 1.8em;
  color: #44403c;
  animation: slideInPaper 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  font-weight: 400;
}

.dark .ProseMirror p {
  color: #d6d3d1;
}
@keyframes slideInPaper {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ProseMirror h1,
.ProseMirror h2,
.ProseMirror h3,
.ProseMirror h4 {
  font-family:
    'Songti SC',
    'Noto Serif SC',
    'Georgia',
    'Times New Roman',
    serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #292524;
  line-height: 1.6;
  margin: 1em 0;
}

.dark .ProseMirror h1,
.dark .ProseMirror h2,
.dark .ProseMirror h3,
.dark .ProseMirror h4 {
  color: #e7e5e4;
}
.ProseMirror blockquote {
  border-left: 3px solid rgba(168, 162, 158, 0.4);
  padding-left: 1.5rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  font-style: italic;
  font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
  color: #57534e;
  background: transparent;
}

.dark .ProseMirror blockquote {
  border-left-color: rgba(120, 113, 108, 0.4);
  color: #a8a29e;
}
.ProseMirror ::selection {
  background-color: rgba(231, 229, 228, 0.6);
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(120, 113, 108, 0.3);
  text-decoration-thickness: 1px;
}

.dark .ProseMirror ::selection {
  background-color: rgba(68, 64, 60, 0.5);
  text-decoration-color: rgba(168, 162, 158, 0.3);
}
.ProseMirror mark {
  background-color: #fef3c7;
  color: #451a03;
  padding: 0.2em 0.4em;
  border-radius: 2px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(217, 119, 6, 0.1);
  font-size: 0.95em;
}

.dark .ProseMirror mark {
  background-color: #451a03;
  color: #fef3c7;
  border-bottom-color: rgba(251, 191, 36, 0.1);
}
.ProseMirror:focus-within p {
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* 摇晃动画 */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0) scale(1);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-8px) scale(1.02);
  }
  20%,
  40%,
  60%,
  70% {
    transform: translateX(8px) scale(1.02);
  }
}

.ai-menu-shake {
  animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  animation-fill-mode: both;
}
.ProseMirror.underline-solid p {
  background-image: linear-gradient(
    to bottom,
    transparent calc(2.2em - 1px),
    var(--underline-color, #a8a29e) calc(2.2em - 1px),
    var(--underline-color, #a8a29e) 2.2em,
    transparent 2.2em
  );
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
